import { defineStore } from 'pinia'
import { reactive } from 'vue'
//消息存储
export const useMessageInfo = defineStore('messageInfo', {
    state: () => {
        return reactive({
            isVisible: false,
            title: '',
            message: '',
        })
    },
    actions: {
        setMessage(title: string, message: string) {
            ;(this.isVisible = true), (this.title = title), (this.message = message)
        },
        clearMessage() {
            ;(this.isVisible = false), (this.title = ''), (this.message = '')
        },
    },
})
